function RefRate()
{
	$.getJSON("op.php?op=xml_3d&fp=rate_5h&playtype="+playtype+"&lotto_id_5h="+lotto_id+"&gametype="+gametype+"&disk="+$("#select_disk").val(),null,function(r){
		switch(playtype)
		{
			case "r1":
				var arr=[2,1,3,4];
				for(k=0;k<arr.length;k++)
				{
					for(i=1;i<=8;i++)
					{
						ChangeRate("rb_"+i+"_"+arr[k]+"_1",r["b"+arr[k]+"_"+i].rates[0]);	
						ChangeRate("rb_"+i+"_"+arr[k]+"_2",r["b"+arr[k]+"_"+i].rates[1]);	
					}
				}
				var arr2=[7,8,9,18];
				for(k=0;k<arr2.length;k++)
				{
					ChangeRate("rb_0_"+arr2[k]+"_1",r["b"+arr2[k]].rates[0]);	
					ChangeRate("rb_0_"+arr2[k]+"_2",r["b"+arr2[k]].rates[1]);	
				}
				break;	
			case "rp1":
			case "rp2":
			case "rp3":
			case "rp4":
			case "rp5":
			case "rp6":
			case "rp7":
			case "rp8":
				var v=playtype.substr(2,3);
				for(i=0;i<20;i++)
				{
					k=(i<9?"0":"")+(i+1);
					ChangeRate("rb_"+v+"_0_"+k,r["b0"].rates[i]);	
				}
				var arr2=[1,2,3,4,5,6];
				for(k=0;k<arr2.length;k++)
				{
					ChangeRate("rb_"+v+"_"+arr2[k]+"_1",r["b"+arr2[k]].rates[0]);	
					ChangeRate("rb_"+v+"_"+arr2[k]+"_2",r["b"+arr2[k]].rates[1]);	
					if(arr2[k]==5)
						ChangeRate("rb_"+v+"_"+arr2[k]+"_3",r["b"+arr2[k]].rates[2]);
					else if(arr2[k]==6)
					{
						ChangeRate("rb_"+v+"_"+arr2[k]+"_3",r["b"+arr2[k]].rates[2]);
						ChangeRate("rb_"+v+"_"+arr2[k]+"_4",r["b"+arr2[k]].rates[3]);
					}
				}
				break;
		}
		
		window.setTimeout("ClearColor()",1000);
	});	
}
$(document).ready(function(e) {
    $("#quick02_a_0 input").bind("click",function(b){
			var arr=new Array();
			var v=playtype.substr(2,3);
			switch($(this).val())
			{
				case '单':
					arr=['01','05','09','13','17','03','07','11','15','19'];
					break;
				case '双':
					arr=['02','04','06','08','10','12','14','16','18','20'];
					break;
				case '大':
					arr=['11','12','13','14','15','16','17','18','19','20'];
					break;
				case '小':
					arr=['01','02','03','04','05','06','07','08','09','10'];
					break;
				case '合单':
					arr=['01','05','09','10','14','18','03','07','12','16'];
					break;
				case '合双':
					arr=['13','17','02','06','11','15','19','04','08','20'];
					break;	
			}
			for(k=0;k<arr.length;k++)
				$("#b_"+v+"_0_"+arr[k]).addClass("selcolor");	
		});
	$("#quick02_a_1 input").bind("click",function(b){
		var arr=new Array();
		var v=playtype.substr(2,3);
		switch($(this).val())
		{
			case " 0 ":
				arr=['01','02','03','04','05','06','07','08','09'];
				break;	
			case " 1 ":
				arr=['10','11','12','13','14','15','16','17','18','19'];
				break;
			case " 2 ":
				arr=['20'];
				break;
		}
		for(k=0;k<arr.length;k++)
			$("#b_"+v+"_0_"+arr[k]).addClass("selcolor");	
	});
	$("#quick02_a_2 input").bind("click",function(b){
		var v=$(this).val();
		var v2=playtype.substr(2,3);
		$("input[name^='b_"+v2+"_0_']").each(function(index, element) {
            var s=element.id.split("_");
			if(parseInt(s[s.length-1].substr(1,1))==parseInt(v))
			{
				$(element).addClass("selcolor");		
			}
        });	
	});
	$("#quick02_a_3 input").bind("click",function(b){
		var arr=new Array();
		var v=playtype.substr(2,3);
		switch($(this).val())
		{
			case "中":
				arr=['01','02','03','04','05','06','07'];
				break;	
			case "发":
				arr=['08','09','10','11','12','13','14'];
				break;
			case "白":
				arr=['15','16','17','18','19','20'];
				break;
		}
		for(k=0;k<arr.length;k++)
			$("#b_"+v+"_0_"+arr[k]).addClass("selcolor");	
	});
	$("#quick02_a_4 input").bind("click",function(b){
		var arr=new Array();
		var v=playtype.substr(2,3);
		switch($(this).val())
		{
			case "东":
				arr=['01','05','09','13','17'];
				break;	
			case "南":
				arr=['02','06','10','14','18'];
				break;
			case "西":
				arr=['03','07','11','15','19'];
				break;
			case "北":
				arr=['04','08','12','16','20'];
				break;
		}
		for(k=0;k<arr.length;k++)
			$("#b_"+v+"_0_"+arr[k]).addClass("selcolor");	
	});
});